		.msfirst
		
#define EQU     .EQU
#define ORG     .ORG
#define RMB     .BLOCK
#define FCB     .BYTE
#define FCC     .TEXT
#define FDB     .WORD
#define END		.END

#define equ     .EQU
#define org     .ORG
#define rmb     .BLOCK
#define fcb     .BYTE
#define fcc     .TEXT
#define fdb     .WORD
#define	end		.END

;*************************************
;some equates for the 6803 hardware
;*************************************
TCSR	EQU		$0008		; Timer Control Status Register
TIMER	EQU		$0009		; Counter
OCR	EQU		$000B		; Output Compare Register
OCV	EQU		$4206		; Output Compare interrupt Vector

;*************************************
;equates for the MC-10 hardware
;*************************************
SVDP	EQU		$bfff		; sound and VDP control register address

;*************************************
;equates for the music player
;*************************************
;MC-10 clock is .89488625Mhz or 894.88625Khz
; We need 2.5Khz interrupts so divide 894.88625 (.89488625 Mhz) by 2.5 = 357.9545... or 358 when rounded.
; subtract 22 to get the value we need or 336 aka $0150
TVAL	EQU		$166		; Timer period - 22  = 314 or $13A
TCSRVAL	EQU		$08			; bit settings for the TCSR
; number of interrupts between calls to Play2
IPCV	EQU		$400			;Interrupt is at 2.5Khz.  2500Hz/60 = 41.6666666... or 42.  It takes 42 interrupts to equal 60Hz


;*************************************
#define PLAYININT 0			; conditional assembly flag to call Play2 from within the interrupt



;*************************************
		.org		$5000

;*************************************
;* Main
;*************************************
Start:
		; Set the Tune pointer
		ldd		#PATTERNS-2	;these two lines are optional *if* always same song
		jsr		PlaySong

		; start the music player interrupt
		jsr		InterruptInit
		
		inc	$4100
		rts
		;endless loop, interrupt does all the rest
busy:

#ifndef PLAYININT
		; if play2 isn't called from the interrupt, check the flag set by the interrupt and call it when needed
		ldaa	PlayFlag
		beq		busy

		jsr		play2
Skip:
#endif
		bra		busy

		
		
;*************************************
; InterruptInit
;  Set up the timer interrupt and handler
;*************************************
InterruptInit:
		sei
		; set the Interrupt Control Vector
		LDAA	#126	;load 'jmp' instruction opcode
		STAA	OCV		;store into OCV vector
		
		LDD		#IntHandler		; store interrupt hander address after JMP instruction
		STD		OCV+1
	
		; set the timer duration
		LDD		#TVAL
		STD		OCR
	
		;reset the counter to $FFF8.
		STAA	TIMER

		; Reset the OCF flag (needed?)
		LDAA	TCSR
		
		;Enable the timer interrupt
		LDAA	#TCSRVAL
		STAA	TCSR

		cli					;enable interrupts

		rts
		
		
;*************************************
; PlaySong
;  pass the pointer to the song pattern in D
;*************************************
PlaySong:
		;keep interrupt from screwing up our data mid setup
		sei					;disable interrupts
		
		std		curpat+1	;starting from a 'cold' start.
		ldx		#NOPAT 		;force $80 to load on first note load 
		stx		XVAL		;save X value for interrupt
		stx		play2+1		;make sure self modifying code starts from scratch again?
		
		ldd		#IPCV		;number of interrupts between calls (60Hz conversion)
		std		count60

		;Let the music play!
		cli					;enable interrupts

		rts

		
;*************************************
;* Interrupt Handler
;*  IRQ automatically preserves registers
;*************************************
IntHandler:
		;check bit 6 (Output Compare Flag) to see if it's the correct interrupt?
		;

		STAA	TIMER		; Reset the timer, interrupts disabled within the interrupt so always kick the timer first
		LDAA	TCSR		; Reset the OCF flag

		; set the timer duration (shouldn't this stay set?)
;		LDD		#TVAL
;		STD		OCR
;******************************************************
;nc/nc 	= no toggle
;nc/c 	= toggle output
;c/nc 	= toggle output
;c/c   	= no toggle
;******************************************************

note

sum		ldd 	#$0000 
freq		addd 	#$0000 
		std 	sum+1	
		bcs	tog	
						
sum2		ldd	#$0000	
		addd	freq2+1	
		std	sum2+1	
		bcc	notog	
						
output
; just hard code the bits for the VDP setting with the bit set
;		ldaa	#$80		;turn sound bit on
		ldaa	TSVDP		;get RAM copy of Sound and VDP setting
		eora  	#$80	
		staa	SVDP		;set the hardware
		stab	TSVDP		;get RAM copy of Sound and VDP setting	
		bra	next

tog		ldd	sum2+1
freq2		addd	#$0000
		std	sum2+1
		bra	output

notog
; and hard code the settings for the VDP with the bit clear
;		ldab	#0			;turn sound bit off	
		ldab	TSVDP		;get RAM copy of Sound and VDP setting	
		andb	#$7f
		stab	SVDP		;set the hardware
;		stab	TSVDP		;get RAM copy of Sound and VDP setting	
;		bra	next			; this does nothing to sync the sound.  Sound is synced by interrupt once you are out of the loop
next:
		;**************************************************************
		; countdown to play2 call
		dec		count60+1
		bne		next1
		dec		count60
		bne		next1

		;reset our counter
		ldd	#IPCV		;number of interrupts between calls (60Hz conversion)
		std	count60

#ifndef PLAYININT
		;set the flag
		inc	PlayFlag	; set the flag.  Just test the PlayFlag for >0 to see if you need to call play2
next1
		rti
#endif

;************************************************
; OK SO FAR
;************************************************
play2
	ldx	#NOPAT

#ifdef DEBUG
	stx	$4000		;just show pointer on screen (test)
#endif

curnote	ldd	,x		;load 2 notes from pattern
	bpl	plnote		;pattern ends with $80 (-ve flag set)

curpat	ldx	#PATTERNS-2	;load pointer to patterns
	inx			
	inx			;bump pattern
	cpx	#PAT0-2		;end of patterns, time to loop
	blo	nxpat

	ldx	#PATTERNS	;first pattern (rem out for loop to another point)
nxpat	stx	curpat+1
	ldx	,x		;load pointer to notes
	ldd	,x		;(replace with bra curnote if there are ever blank patterns)

plnote	inx
	inx
	stx	play2+1
	asld			;*2 for for lookup
	staa	ok1+1
	stab	ok2+1

	ldx	#freqtab	;freq table pointer	
ok1	ldd	0,x		;get the right freq
stor1	std	freq+1		;store
ok2	ldd	0,x		;get the freq for chan2
stor2	std	freq2+1
;************************************************


#ifndef PLAYININT
		clr		PlayFlag
		RTS				;return from subroutine
#else
next1		
		RTI			;return from the interrupt
#endif
;****** end of interrupt handler



;******************************************************
;equal tempered 12 note per octave frequency table
;******************************************************
XVAL	FDB	IPCV
count60		FDB	IPCV
TSVDP		FCB 0		;Temporary Sound and VDP settings

#ifndef PLAYININT
PlayFlag	FCB	$00		;flag for main code to call play2 if not included in interrupt
#endif

freqtab		fdb	0,577,611,647,686,727,770,816,864,915,970,1028
		fdb	1089,1153,1222,1295,1372,1453,1540,1631,1728,1831,1940,2055
		fdb	2177,2307,2444,2589,2743,2906,3079,3262,3456,3662,3879,4110
		fdb	4355,4613,4888,5178,5486,5813,6158,6524,6912,7323,7759,8220
		fdb	8709,9227,9775,10357,10972,11625,12316,13049,13825,14647,15518,16440
	

;******************************************************
; PATTERN POINTERS
;******************************************************

PATLOOP
PATTERNS
	fdb PAT0
	fdb PAT0
	fdb PAT0
	fdb PAT0
	fdb PAT0
	fdb PAT0
	fdb PAT0
	fdb PAT0
	fdb PAT9
	fdb PAT9
	fdb PAT9
	fdb PAT9
	fdb PAT9
	fdb PAT9
	fdb PAT9
	fdb PAT9
	fdb PAT1
	fdb PAT1
	fdb PAT1
	fdb PAT1
	fdb PAT2
	fdb PAT2
	fdb PAT2
	fdb PAT2
	fdb PAT3
	fdb PAT3
	fdb PAT3
	fdb PAT3
	fdb PAT4
	fdb PAT4
	fdb PAT4
	fdb PAT4
	fdb PAT1
	fdb PAT1
	fdb PAT1
	fdb PAT1
	fdb PAT2
	fdb PAT2
	fdb PAT2
	fdb PAT2
	fdb PAT3
	fdb PAT3
	fdb PAT3
	fdb PAT3
	fdb PAT4
	fdb PAT4
	fdb PAT4
	fdb PAT4
	fdb PAT10
	fdb PAT10
	fdb PAT10
	fdb PAT10
	fdb PAT11
	fdb PAT11
	fdb PAT11
	fdb PAT11
	fdb PAT12
	fdb PAT12
	fdb PAT12
	fdb PAT12
	fdb PAT13
	fdb PAT13
	fdb PAT14
	fdb PAT14
	fdb PAT11
	fdb PAT11
	fdb PAT11
	fdb PAT11
	fdb PAT12
	fdb PAT12
	fdb PAT12
	fdb PAT12
	fdb PAT13
	fdb PAT13
	fdb PAT13
	fdb PAT13
	fdb PAT14
	fdb PAT14
	fdb PAT14
	fdb PAT14
	fdb PAT5
	fdb PAT5
	fdb PAT5
	fdb PAT5
	fdb PAT6
	fdb PAT6
	fdb PAT6
	fdb PAT6
	fdb PAT7
	fdb PAT7
	fdb PAT7
	fdb PAT7
	fdb PAT8
	fdb PAT8
	fdb PAT8
	fdb PAT8
	fdb PAT5
	fdb PAT5
	fdb PAT5
	fdb PAT5
	fdb PAT6
	fdb PAT6
	fdb PAT6
	fdb PAT6
	fdb PAT7
	fdb PAT7
	fdb PAT7
	fdb PAT7
	fdb PAT8
	fdb PAT8
	fdb PAT8
	fdb PAT8
	fdb PAT15
	fdb PAT15
	fdb PAT15
	fdb PAT19
	fdb PAT20
	fdb PAT20
	fdb PAT20
	fdb PAT21
	fdb PAT22
	fdb PAT22
	fdb PAT22
	fdb PAT22
	fdb PAT23
	fdb PAT23
	fdb PAT23
	fdb PAT28
	fdb PAT24
	fdb PAT24
	fdb PAT24
	fdb PAT24
	fdb PAT25
	fdb PAT25
	fdb PAT25
	fdb PAT25
	fdb PAT26
	fdb PAT26
	fdb PAT26
	fdb PAT26
	fdb PAT27
	fdb PAT27
	fdb PAT27
	fdb PAT27
	fdb PAT24
	fdb PAT24
	fdb PAT24
	fdb PAT24
	fdb PAT25
	fdb PAT25
	fdb PAT25
	fdb PAT25
	fdb PAT26
	fdb PAT26
	fdb PAT26
	fdb PAT26
	fdb PAT27
	fdb PAT27
	fdb PAT27
	fdb PAT27
	fdb PAT29
	fdb PAT29
	fdb PAT29
	fdb PAT29
	fdb PAT30
	fdb PAT30
	fdb PAT30
	fdb PAT30
	fdb PAT31
	fdb PAT31
	fdb PAT31
	fdb PAT31
	fdb PAT32
	fdb PAT32
	fdb PAT32
	fdb PAT32
	fdb PAT17
	fdb PAT17
	fdb PAT33
	fdb PAT33
	fdb PAT18
	fdb 0

PAT0
	fcb $f,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $f,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
NOPAT	fcb $80,$00

PAT1
	fcb $f,$f
	fcb $0,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $0,$0
	fcb $33,$1b
	fcb $3a,$1b
	fcb $f,$f
	fcb $0,$33
	fcb $1b,$3a
	fcb $1b,$0
	fcb $f,$f
	fcb $0,$0
	fcb $f,$0
	fcb $f,$0
	fcb $80,$00

PAT2
	fcb $f,$f
	fcb $0,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $0,$0
	fcb $31,$1b
	fcb $38,$1b
	fcb $f,$f
	fcb $0,$31
	fcb $1b,$38
	fcb $1b,$0
	fcb $f,$f
	fcb $0,$0
	fcb $f,$0
	fcb $f,$0
	fcb $80,$00

PAT3
	fcb $f,$f
	fcb $0,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $0,$0
	fcb $2f,$1b
	fcb $36,$1b
	fcb $f,$f
	fcb $0,$2f
	fcb $1b,$36
	fcb $1b,$0
	fcb $f,$f
	fcb $0,$0
	fcb $f,$0
	fcb $f,$0
	fcb $80,$00

PAT4
	fcb $f,$f
	fcb $0,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $0,$0
	fcb $2e,$1b
	fcb $35,$1b
	fcb $f,$f
	fcb $0,$2e
	fcb $1b,$35
	fcb $1b,$0
	fcb $f,$f
	fcb $0,$0
	fcb $f,$0
	fcb $f,$0
	fcb $80,$00

PAT5
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $f,$0
	fcb $33,$1b
	fcb $3a,$1b
	fcb $f,$f
	fcb $f,$33
	fcb $1b,$3a
	fcb $1b,$0
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$f
	fcb $1b,$0
	fcb $80,$00

PAT6
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $f,$0
	fcb $31,$1b
	fcb $38,$1b
	fcb $f,$f
	fcb $f,$31
	fcb $1b,$38
	fcb $1b,$0
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$f
	fcb $1b,$0
	fcb $80,$00

PAT7
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $f,$0
	fcb $2f,$1b
	fcb $36,$1b
	fcb $f,$f
	fcb $f,$2f
	fcb $1b,$36
	fcb $1b,$0
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$f
	fcb $1b,$0
	fcb $80,$00

PAT8
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$0
	fcb $22,$0
	fcb $f,$f
	fcb $f,$0
	fcb $2e,$1b
	fcb $35,$1b
	fcb $f,$f
	fcb $f,$2e
	fcb $1b,$35
	fcb $1b,$0
	fcb $f,$f
	fcb $f,$0
	fcb $1b,$f
	fcb $1b,$0
	fcb $80,$00

PAT9
	fcb $f,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $f,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $80,$00

PAT10
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$27
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$27
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$27
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$27
	fcb $1b,$1b
	fcb $80,$00

PAT11
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$2a
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$2a
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$2a
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$2a
	fcb $1b,$1b
	fcb $80,$00

PAT12
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$29
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$29
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$29
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$29
	fcb $1b,$1b
	fcb $80,$00

PAT13
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$22
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$22
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$22
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$22
	fcb $1b,$1b
	fcb $80,$00

PAT14
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$25
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$25
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$25
	fcb $1b,$1b
	fcb $f,$f
	fcb $f,$1b
	fcb $1b,$25
	fcb $1b,$1b
	fcb $80,$00

PAT15
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $f,$0
	fcb $f,$27
	fcb $f,$2e
	fcb $f,$0
	fcb $f,$27
	fcb $f,$2e
	fcb $f,$0
	fcb $f,$0
	fcb $80,$00

PAT17
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $f,$1b
	fcb $80,$00

PAT18
	fcb $0,$f
	fcb $0,$f
	fcb $0,$f
	fcb $0,$f
	fcb $0,$f
	fcb $0,$f
	fcb $0,$f
	fcb $0,$f
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $0,$0
	fcb $80,$00

PAT19
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $1b,$0
	fcb $1b,$27
	fcb $1b,$2e
	fcb $16,$0
	fcb $16,$27
	fcb $16,$2e
	fcb $12,$0
	fcb $12,$0
	fcb $80,$00

PAT20
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $d,$0
	fcb $d,$27
	fcb $d,$2e
	fcb $d,$0
	fcb $d,$27
	fcb $d,$2e
	fcb $d,$0
	fcb $d,$0
	fcb $80,$00

PAT21
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $d,$0
	fcb $d,$27
	fcb $d,$2e
	fcb $11,$0
	fcb $11,$27
	fcb $11,$2e
	fcb $14,$0
	fcb $14,$0
	fcb $80,$00

PAT22
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $14,$0
	fcb $14,$27
	fcb $14,$2e
	fcb $14,$0
	fcb $14,$27
	fcb $14,$2e
	fcb $14,$0
	fcb $14,$0
	fcb $80,$00

PAT23
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $16,$0
	fcb $16,$27
	fcb $16,$2e
	fcb $16,$0
	fcb $16,$27
	fcb $16,$2e
	fcb $16,$0
	fcb $16,$0
	fcb $80,$00

PAT24
	fcb $1b,$22
	fcb $1b,$2e
	fcb $f,$2c
	fcb $f,$27
	fcb $1e,$1b
	fcb $1e,$2e
	fcb $f,$2c
	fcb $f,$27
	fcb $20,$1e
	fcb $20,$2e
	fcb $f,$2c
	fcb $f,$27
	fcb $22,$20
	fcb $22,$2e
	fcb $f,$2c
	fcb $f,$27
	fcb $80,$00

PAT25
	fcb $1b,$22
	fcb $1b,$2e
	fcb $d,$2c
	fcb $d,$27
	fcb $1e,$1b
	fcb $1e,$2e
	fcb $d,$2c
	fcb $d,$27
	fcb $20,$1e
	fcb $20,$2e
	fcb $d,$2c
	fcb $d,$27
	fcb $22,$20
	fcb $22,$2e
	fcb $d,$2c
	fcb $d,$27
	fcb $80,$00

PAT26
	fcb $1b,$22
	fcb $1b,$33
	fcb $b,$2e
	fcb $b,$2a
	fcb $1e,$1b
	fcb $1e,$33
	fcb $b,$2e
	fcb $b,$2a
	fcb $20,$1e
	fcb $20,$33
	fcb $b,$2e
	fcb $b,$2a
	fcb $22,$20
	fcb $22,$33
	fcb $b,$2e
	fcb $b,$2a
	fcb $80,$00

PAT27
	fcb $1b,$22
	fcb $1b,$31
	fcb $a,$2e
	fcb $a,$29
	fcb $1e,$1b
	fcb $1e,$31
	fcb $a,$2e
	fcb $a,$29
	fcb $20,$1e
	fcb $20,$31
	fcb $a,$2e
	fcb $a,$29
	fcb $22,$20
	fcb $22,$31
	fcb $a,$2e
	fcb $a,$29
	fcb $80,$00

PAT28
	fcb $27,$27
	fcb $2e,$2e
	fcb $0,$0
	fcb $27,$0
	fcb $2e,$0
	fcb $0,$0
	fcb $0,$27
	fcb $0,$2e
	fcb $16,$22
	fcb $16,$22
	fcb $15,$21
	fcb $14,$20
	fcb $13,$1f
	fcb $12,$1e
	fcb $11,$1d
	fcb $10,$1c
	fcb $80,$00

PAT29
	fcb $1b,$22
	fcb $1b,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $1e,$1b
	fcb $1e,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $20,$1e
	fcb $20,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $22,$20
	fcb $22,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $80,$00

PAT30
	fcb $19,$22
	fcb $19,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $1e,$1b
	fcb $1e,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $20,$1e
	fcb $20,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $22,$20
	fcb $22,$2e
	fcb $0,$2c
	fcb $0,$27
	fcb $80,$00

PAT31
	fcb $17,$22
	fcb $17,$33
	fcb $0,$2e
	fcb $0,$2a
	fcb $1e,$1b
	fcb $1e,$33
	fcb $0,$2e
	fcb $0,$2a
	fcb $20,$1e
	fcb $20,$33
	fcb $0,$2e
	fcb $0,$2a
	fcb $22,$20
	fcb $22,$33
	fcb $0,$2e
	fcb $0,$2a
	fcb $80,$00

PAT32
	fcb $16,$22
	fcb $16,$31
	fcb $0,$2e
	fcb $0,$29
	fcb $1e,$1b
	fcb $1e,$31
	fcb $0,$2e
	fcb $0,$29
	fcb $20,$1e
	fcb $20,$31
	fcb $0,$2e
	fcb $0,$29
	fcb $22,$20
	fcb $22,$31
	fcb $0,$2e
	fcb $0,$29
	fcb $80,$00

PAT33
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $f,$f
	fcb $80,$00



	.end	
